home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / sheriffa / frmlicen.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-05-19  |  3.1 KB  |  102 lines

  1. VERSION 5.00
  2. Begin VB.Form frmLicence 
  3.    Caption         =   "Licence Registration"
  4.    ClientHeight    =   2784
  5.    ClientLeft      =   48
  6.    ClientTop       =   276
  7.    ClientWidth     =   4800
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   2784
  10.    ScaleWidth      =   4800
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.TextBox editLicenceKey 
  13.       Height          =   372
  14.       Left            =   480
  15.       TabIndex        =   5
  16.       Top             =   1440
  17.       Width           =   3972
  18.    End
  19.    Begin VB.CommandButton btnCancel 
  20.       Caption         =   "&Cancel"
  21.       Height          =   372
  22.       Left            =   3000
  23.       TabIndex        =   4
  24.       Top             =   2160
  25.       Width           =   972
  26.    End
  27.    Begin VB.CommandButton btnOK 
  28.       Caption         =   "&OK"
  29.       Height          =   372
  30.       Left            =   720
  31.       TabIndex        =   3
  32.       Top             =   2160
  33.       Width           =   1092
  34.    End
  35.    Begin VB.TextBox editReference 
  36.       BackColor       =   &H8000000B&
  37.       Height          =   288
  38.       Left            =   480
  39.       Locked          =   -1  'True
  40.       TabIndex        =   1
  41.       Top             =   600
  42.       Width           =   3972
  43.    End
  44.    Begin VB.Label Label2 
  45.       Caption         =   "Licence Key:"
  46.       Height          =   252
  47.       Left            =   240
  48.       TabIndex        =   2
  49.       Top             =   1080
  50.       Width           =   1692
  51.    End
  52.    Begin VB.Label Label1 
  53.       Caption         =   "Reference Code:"
  54.       Height          =   252
  55.       Left            =   240
  56.       TabIndex        =   0
  57.       Top             =   240
  58.       Width           =   1332
  59.    End
  60. Attribute VB_Name = "frmLicence"
  61. Attribute VB_GlobalNameSpace = False
  62. Attribute VB_Creatable = False
  63. Attribute VB_PredeclaredId = True
  64. Attribute VB_Exposed = False
  65. Private m_bIsLicenceOK As Boolean
  66. Private Sub Form_Load()
  67.     Dim bRet As Boolean
  68.     Dim strReference As String
  69.     strReference = String$(128, 0)
  70.     bRet = Sheriff.GetReference(strReference)
  71.     frmLicence.editReference.Text = strReference
  72.     m_bIsLicenceOK = False
  73. End Sub
  74. Private Sub btnCancel_Click()
  75.     Unload Me
  76. End Sub
  77. Private Sub btnOK_Click()
  78.     Dim bRet As Boolean
  79.     Dim strReference As String
  80.     Dim strLicence As String
  81.     strReference = editReference.Text
  82.     strLicence = editLicenceKey.Text
  83.     Dim strTitle As String
  84.     strTitle = "Licence Registation"
  85.     bRet = Sheriff.SetLicence(strReference, strLicence)
  86.     If (bRet = True) Then
  87.         Dim strMsg As String
  88.         strMsg = "The licence has been registered successfully!"
  89.         MsgBox strMsg, vbOKOnly, strTitle
  90.         Unload Me
  91.         m_bIsLicenceOK = True
  92.         Exit Sub
  93.     End If
  94.     Dim strErrorMsg As String
  95.     strErrorMsg = String$(256, 0)
  96.     bRet = Sheriff.GetLastErrorMessage(strErrorMsg)
  97.     MsgBox strErrorMsg, vbExclamation, strTitle
  98. End Sub
  99. Public Function IsLicenceOK() As Boolean
  100.     IsLicenceOK = m_bIsLicenceOK
  101. End Function
  102.